// TurtleWnd.h: interface for the CTurtleWnd class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TURTLEWND_H__C0688358_88D5_4BA3_B4CA_19251D9A12D3__INCLUDED_)
#define AFX_TURTLEWND_H__C0688358_88D5_4BA3_B4CA_19251D9A12D3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/*
 * The turtle is shown by a wiundow covering CCanvasWnd.
 *  Using SetWindowRgn to only show a portion of the window.
 *  The region is turtle-shaped. And by set the region, the turtle moves, rotates.
 */
#include "SimpleWnd/SimpleWnd.h"
#include "CanvasDoc.h"

class CTurtleWnd : public CWnd
{
public:
	CTurtleWnd();
	virtual ~CTurtleWnd();

	HWND CreateTurtleWnd(HWND hParent, RECT& rect);
    LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	void DrawTurtle(CCanvasDoc* pDoc);
	
BEGIN_MSG_MAP(CTurtleWnd)
    MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
END_MSG_MAP()

protected:
	HBRUSH	m_brTurtle;
	HRGN CTurtleWnd::CreateTurtleRgn (CCanvasDoc* pDoc);
};

#endif // !defined(AFX_TURTLEWND_H__C0688358_88D5_4BA3_B4CA_19251D9A12D3__INCLUDED_)
